import defaultSettings from '@/settings'

const { showClickCountSort,menuWidth,name,disableZoom,isLogin,screenWidth,noShowHorizontalMenu,isConnectJava,isShowSetting,isShowVerticalMenu,isShowHorizontalMenu,systemId,showClickCount,headerTip} = defaultSettings
export default {
  state: {
    showClickCountSort,
    menuWidth,
    name,
    disableZoom,
    isLogin,
    isShowSetting,
    screenWidth,
    noShowHorizontalMenu,
    isConnectJava,
    isShowVerticalMenu,
    isShowHorizontalMenu,
    systemId,
    showClickCount,
    headerTip
  },
  mutations: {
    CHANGE_SETTING: (state, { key, value }) => {
      // eslint-disable-next-line no-prototype-builtins
      if (state.hasOwnProperty(key)) {
        state[key] = value
      }
    }
  },
  actions: {
    changeSetting({ commit }, data) {
      commit('CHANGE_SETTING', data)
    }
  },
};
